using FreeDraw;
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public class EraserButton : MonoBehaviour
{
	private Button m_Button;

	private void Awake()
	{
		m_Button = GetComponent<Button>();
	}

	private void Start()
	{
		m_Button.onClick.AddListener(OnButtonClicked);
	}

	private void OnDestroy()
	{
		m_Button.onClick.RemoveListener(OnButtonClicked);
	}

	private void OnButtonClicked()
	{
		Drawable.drawable.ResetCanvas();
	}
}
